﻿using CommunityToolkit.Mvvm.ComponentModel;
using StudentAgeSaveEditor.Models;

namespace StudentAgeSaveEditor.ViewModel
{
    partial class BagTableViewModel : ObservableObject
    {
        [ObservableProperty]
        public Dictionary<int, ItemData>? itemDict;
        [ObservableProperty]
        public Dictionary<int, BookData>? bookDict;
        [ObservableProperty]
        public Dictionary<int, long>? historyGetItemDict;
        [ObservableProperty]
        public List<int>? historyReadBooks;
        [ObservableProperty]
        public int readingBookId;
        [ObservableProperty]
        public float overflowReadingSpeed;
        [ObservableProperty]
        public int posterId;
        [ObservableProperty]
        public List<ulong>? posterEffect;

        public void Init(ref BagModel bag)
        {
            ItemDict = bag.itemDict;
            BookDict = bag.bookDict;
            HistoryGetItemDict =bag.historyGetItemDict;
            HistoryReadBooks = bag.historyReadBooks;
            ReadingBookId = bag.readingBookId;
            OverflowReadingSpeed = bag.overflowReadingSpeed;
            PosterId = bag.posterId;
            PosterEffect = bag.posterEffect;
        }
    }
}
